<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>定时任务日志管理</title>
	<meta name="decorator" content="adminlte"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
			$(".contact").click(function(){
				$(".us"). toggle("slow");
			});
			
		});
	</script>
	<style type="text/css">
		.contact{
			width:100px;
			height:30px;
			line-height:30px;
			margin:0 0 0 50px;
			color:#fff;
			background-color:#54b4eb;
			text-align:center;
			}
		.us{
			display:none;
			width:500px;
			padding:10px;
			position:absolute;
			top:100px;
			right:50px;
			color:#fff;
			background-color:#54b4eb;
		}
	</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/job/scheduleJob/">定时任务日志列表</a></li>
		<li class="active"><a href="${ctx}/job/scheduleJob/form?id=${scheduleJob.id}">定时任务日志<shiro:hasPermission name="job:scheduleJob:edit">${not empty scheduleJob.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="job:scheduleJob:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="scheduleJob" action="${ctx}/job/scheduleJob/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">bean名称：</label>
			<div class="controls">
				<form:input path="beanName" htmlEscape="false" maxlength="200" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">方法名：</label>
			<div class="controls">
				<form:input path="methodName" htmlEscape="false" maxlength="100" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">参数：</label>
			<div class="controls">
				<form:input path="params" htmlEscape="false" maxlength="2000" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group" style="positive:relative">
			<label class="control-label">cron表达式：</label>
			<div class="controls">
				<form:input path="cronExpression" htmlEscape="false" maxlength="100" class="input-xlarge "/>
				<div class="contact" style="display:inline-block">点我提示</div>
				<div class="us">Cron表达式范例：</br>
		                				 每隔5秒执行一次：*/5 * * * * ? </br>
									                 每隔1分钟执行一次：0 */1 * * * ?</br>
									                 每天23点执行一次：0 0 23 * * ?</br>
									                 每天凌晨1点执行一次：0 0 1 * * ?</br>
									                 每月1号凌晨1点执行一次：0 0 1 1 * ?</br>
									                 每月最后一天23点执行一次：0 0 23 L * ?</br>
									                 每周星期天凌晨1点实行一次：0 0 1 ? * L</br>
									                 在26分、29分、33分执行一次：0 26,29,33 * * * ?</br>
									                 每天的0点、13点、18点、21点都执行一次：0 0 0,13,18,21 * * ?</br>
				</div>
			</div>
			
		</div>
		<div class="control-group">
			<label class="control-label">任务状态：</label>
			<div class="controls">
				<form:select path="status" class="input-xlarge ">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('schedule_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="job:scheduleJob:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>